<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="resources/css/doctor/roomlist.css">
<link rel="stylesheet"
	href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
<script type="text/javascript"
	src="//cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
<link type="text/css" rel="stylesheet"
	href="resources/css/medical/m_waiting_list.css">
<script type="text/javascript">
	$(document).ready(function() {
		//완료 버튼 클릭 시
		infosubmit = function(aaaa) {
			var idx = $('#subbtn').index(aaaa);
			if (idx == 0) {
				if (confirm("정말로 전송하시겠습니까?") == true) { // 확인
					$(".fileupload").eq(idx).submit();
				} else { // 취소
					return;
				}
			} else {
				alert("순서가 아닙니다");
			}
		}
		$('#myTable').dataTable();
		
	});
	
</script>
</head>
<body>
	<header>
		<div class="header_div">
			<a href="mwaiting.medic" class="header_link" accesskey="1">대기리스트</a>
			<a href="loginform.do" class="header_link2" accesskey="2"> 로그아웃</a>
			
		</div>
	</header>
	<article>
		<div class="m_waiting_list_div">
			<div class="waiting_list_table">
				<table id="myTable" class="display">
					<thead>
						<tr>
							<th>접수번호</th>
							<th>환자명</th>
							<th>진료과</th>
							<th>의사명</th>
							<th>소견</th>
							<th>접수시간</th>
							<th>파일첨부</th>
							<th>보내기</th>
						</tr>
					</thead>
					<tbody id="tbody">
						<c:forEach var="r" items="${radiolist}">
							<tr class="radioTr">
								<td>${r.jupsoo_id}</td>
								<td>${r.name}</td>
								<td>${r.dept_name}</td>
								<td>${r.doctor_name}<input type='hidden' class='doctor_id'
									value='${r.doctor_id}'></td>
								<td>${r.opinion}</td>
								<td>${r.radio_jupsoo_time}</td>
								<td>
									<form action="fileupload.medic" id="fileupload"
										class="fileupload" enctype="multipart/form-data" method="post">
										<input type="hidden" name="jupsoo_id" value="${r.jupsoo_id }">
										<input type='hidden' name="cheobang_temp_id"
											value='${r.cheobang_temp_id}'> 
											<input type="file" id="txtFile" name="file" class="normalBtn">
										<!-- <img alt="" src="./resources/images/medical/files.png" width="20px" height="20px"> -->
									</form>
								</td>
								<td><input type="button" id="subbtn" class="normalBtn"
									value="완료" onclick="infosubmit(this);"></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
		</div>
	</article>
</body>
</html>